rem install vs build tools and msys2
powershell -ExecutionPolicy Bypass -File init-env.ps1
if %errorlevel% neq 0 exit /b %errorlevel%
set FF_PLATFORM_TYPE=%3
rem pull repos
"C:\Program Files\Git\bin\bash.exe" init-repo_win.sh
if %errorlevel% neq 0 exit /b %errorlevel%

rem build libraries
chcp 65001
set CHERE_INVOKING=yes
set MSYSTEM=MINGW64
set MSYS2_PATH_TYPE=inherit
set PATH_BK=%PATH%
set PATH=%PATH%;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin
set FF_CONFIG_TYPE=%3_64
call "%VisualStudio_VCPath%\Auxiliary\Build\vcvars64.bat"
C:\msys64\usr\bin\bash.exe -lc './build64.sh'
set PATH=%PATH_BK%
if %errorlevel% neq 0 exit 1